/**
 * 过滤器文件
 */
import dayjs from "dayjs"
import BigNumber from "bignumber.js"
export function FormatDate(date, format) {
	let _format = format || "YYYY-MM-DD HH:mm:ss";
	return dayjs(date).format(_format)
}
export function FormatDistance(distance) {
	debugger
	if(!distance){
		return ''
	}
	let dis = parseInt(distance)
	if (dis < 1000) {
		return dis + '米'
	} else {
		return new BigNumber(dis).div(1000).dp(2, BigNumber.ROUND_UP).toNumber() + '公里'
	}
}
